﻿using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using ReflectionStudio.Core.Events;
namespace WPFExcelReport
{
    public partial class K0267
    {
        public K0267()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            SDSA = "0267";
            InitializeComponent();
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            if(dwMain==null)
            { }
            if (dwMaster == null)
            {
                KEY = "";
            }
            else
            {
                KEY = dwMaster["KEY"].ToString().PadRight(10) + dwMaster["V3"].ToString().PadRight(10) + dwMaster["V4"].ToString().PadRight(10) + dwMaster["V5"].ToString().PadRight(10);
            }
        }
        public override void LOADALL()
        {
            base.LOADALL();
            foreach (DataRow row in TBMain.Rows)
            {
                row["SDES"] = Helpers.Helper.Convert8859P1ToGB2312(row["SDES"].ToString().Trim());
                row["DES"] = Helpers.Helper.Convert8859P1ToGB2312(row["DES"].ToString().Trim());
            }
        }
        public override void OnEXAUFChg(string vlaue)
        {
            SDES = "";
            KEY = "";
            LOADALL();
            if (vlaue == "")
                return;
            Locate("KEY", vlaue.PadRight(3).Substring(0, 3));
          //  base.OnEXAUFChg(vlaue);
        }
        public override void LOADBYAUF()
        {
            if (ORDERNUM == "")
                return;
            Locate("KEY", ORDERNUM.PadRight(3).Substring(0, 3));
          //  base.LOADBYAUF();
        }
    }
}
